<?php /*a:3:{s:76:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\stattrade\stat_predeposit.html";i:1591758938;s:64:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\public\header.html";i:1571626691;s:69:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\public\admin_items.html";i:1566788179;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>DSShop单店铺商城系统后台</title>
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <link rel="stylesheet" href="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/css/admin.css">
        <link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.css">
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery-2.1.4.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.validate.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.cookie.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/common.js"></script>
        <script src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/admin.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery.ui.datepicker-zh-CN.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/perfect-scrollbar.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/layer/layer.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>

        <script type="text/javascript">
            var BASESITEROOT = "<?php echo htmlentities(BASE_SITE_ROOT); ?>";
            var ADMINSITEROOT = "<?php echo htmlentities(ADMIN_SITE_ROOT); ?>";
            var BASESITEURL = "<?php echo htmlentities(BASE_SITE_URL); ?>";
            var HOMESITEURL = "<?php echo htmlentities(HOME_SITE_URL); ?>";
            var ADMINSITEURL = "<?php echo htmlentities(ADMIN_SITE_URL); ?>";
        </script>
    </head>
    <body>
        <div id="append_parent"></div>
        <div id="ajaxwaitid"></div>







<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>销量分析</h3>
                <h5></h5>
            </div>
            <?php if($admin_item): ?>
<ul class="tab-base ds-row">
    <?php if(is_array($admin_item) || $admin_item instanceof \think\Collection || $admin_item instanceof \think\Paginator): if( count($admin_item)==0 ) : echo "" ;else: foreach($admin_item as $key=>$item): ?>
    <li><a href="<?php echo htmlentities($item['url']); ?>" <?php if($item['name'] == $curitem): ?>class="current"<?php endif; ?>><span><?php echo htmlentities($item['text']); ?></span></a></li>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</ul>
<?php endif; ?>
        </div>
    </div>
   <div class="fixed-empty"></div>
<form method="get"  name="formSearch" id="formSearch">
    <input type="hidden" name="" value="" />
    <div class="ds-search-form">
            <dl>
                <dd>
                    <select name="pd_type" id="pd_type" class="querySelect">
                        <option value="recharge" <?php echo app('request')->param('pd_type')=='recharge'?'selected':''; ?>>充值</option>
                        <option value="order_pay" <?php echo app('request')->param('pd_type')=='order_pay'?'selected':''; ?>>消费</option>
                        <option value="cash_pay" <?php echo app('request')->param('pd_type')=='cash_pay'?'selected':''; ?>>提现</option>
                        <option value="refund" <?php echo app('request')->param('pd_type')=='refund'?'selected':''; ?>>退款</option>
                    </select>
                </dd>
                <dd>
                    <select name="search_type" id="search_type" class="querySelect">
                        <option value="day" <?php echo app('request')->param('search_type')=='day'?'selected':''; ?>>按照天统计</option>
                        <option value="week"  <?php echo app('request')->param('search_type')=='week'?'selected':''; ?>>按照周统计</option>
                        <option value="month" <?php echo app('request')->param('search_type')=='month'?'selected':''; ?>>按照月统计</option>
                    </select>
                </dd>
                <dd id="searchtype_day" style="display:none;">
                    <input class="txt date" type="text" value="<?php echo htmlentities(app('request')->param('search_time')); ?>" id="search_time" name="search_time">
                </dd>
                <dd id="searchtype_week" style="display:none;">
                    <select name="search_time_year" class="querySelect">
                        <?php if(is_array($year_arr) || $year_arr instanceof \think\Collection || $year_arr instanceof \think\Paginator): if( count($year_arr)==0 ) : echo "" ;else: foreach($year_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $current_year==$key ? 'selected' : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <select name="search_time_month" class="querySelect">
                        <?php if(is_array($month_arr) || $month_arr instanceof \think\Collection || $month_arr instanceof \think\Paginator): if( count($month_arr)==0 ) : echo "" ;else: foreach($month_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $current_month==$key ? 'selected'  : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <select name="search_time_week" class="querySelect">
                        <?php if(is_array($week_arr) || $week_arr instanceof \think\Collection || $week_arr instanceof \think\Paginator): if( count($week_arr)==0 ) : echo "" ;else: foreach($week_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($v['key']); ?>" <?php echo $current_week==$v['key'] ? 'selected'  : ''; ?>><?php echo htmlentities($v['val']); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </dd>
                <dd id="searchtype_month" style="display:none;">
                    <select name="search_time_year" class="querySelect">
                        <?php if(is_array($year_arr) || $year_arr instanceof \think\Collection || $year_arr instanceof \think\Paginator): if( count($year_arr)==0 ) : echo "" ;else: foreach($year_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $current_year==$key ? 'selected' : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <select name="search_time_month" class="querySelect">
                        <?php if(is_array($month_arr) || $month_arr instanceof \think\Collection || $month_arr instanceof \think\Paginator): if( count($month_arr)==0 ) : echo "" ;else: foreach($month_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $current_month==$key ? 'selected' : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </dd>
            </dl>
            <div class="btn_group">
                <a href="javascript:void(0);" id="dssubmit" class="btn tooltip" ><?php echo htmlentities(lang('ds_query')); ?></a>
                <a href="<?php echo url('Stattrade/predeposit'); ?>" class="btn btn-default" title="<?php echo htmlentities(lang('ds_cancel')); ?>"><?php echo htmlentities(lang('ds_cancel')); ?></a>
            </div>
        </div>
  </form>

<div class="stat-info">
  <span>存入金额：
    <strong><?php echo number_format($stat_array['recharge_amount'],2); ?></strong>
    元</span>
  <span>消费金额：
    <strong><?php echo number_format($stat_array['order_amount'],2); ?></strong>
    元</span>
  <span>提现金额：
    <strong><?php echo number_format($stat_array['cash_amount'],2); ?></strong>
    元</span>
  <span>总余额：
    <strong><?php echo number_format($usable_amount,2); ?></strong>
    元</span>
  <span>使用总人数：
    <strong><?php echo intval($user_amount); ?></strong>
    </span>
</div>
  <div id="container" class="w100pre close_float" style="height:400px"></div>
  <div style="text-align:right;">
    <input type="hidden" id="export_type" data-url="<?php echo url(request()->controller().'/'.request()->action()); ?>/exporttype/excel" name="export_type" data-param='{"url":"<?php echo htmlentities($actionurl); ?>/pd_type/<?php echo htmlentities(app('request')->param('pd_type')); ?>/exporttype/excel"}' value="excel"/>
    <a class="btn btn-mini" href="javascript:void(0);" id="export_btn"><span>导出Excel</span></a> </div>
  <table class="ds-default-table">
    <thead>
      <tr class="thead">
        <th class="align-center">会员名称</th>
        <th class="align-center">创建时间</th>
        <th class="align-center">可用金额（元）</th>
        <th class="align-center">冻结金额（元）</th>
        <th class="align-center">管理员名称</th>
        <th class="align-center">类型</th>
        <th class="align-center">描述</th>
      </tr>
    </thead>
    <tbody id="datatable">
    <?php if(!(empty($log_list) || (($log_list instanceof \think\Collection || $log_list instanceof \think\Paginator ) && $log_list->isEmpty()))): if(is_array($log_list) || $log_list instanceof \think\Collection || $log_list instanceof \think\Paginator): if( count($log_list)==0 ) : echo "" ;else: foreach($log_list as $key=>$v): ?>
      <tr class="hover">
        <td class="align-center"><?php echo htmlentities($v['lg_member_name']); ?></td>
        <td class="align-center"><?php echo date('Y-m-d H:i:s',$v['lg_addtime']); ?></td>
        <td class="align-center"><?php echo htmlentities($v['lg_av_amount']); ?></td>
        <td class="align-center"><?php echo htmlentities($v['lg_freeze_amount']); ?></td>
        <td class="align-center"><?php echo htmlentities($v['lg_admin_name']); ?></td>
        <td class="align-center">
          <?php switch($v['lg_type']): case "recharge": ?>充值<?php break; case "order_pay": ?>消费<?php break; case "cash_pay": ?>提现<?php break; case "refund": ?>退款<?php break; ?>
          <?php endswitch; ?>
          </td>
        <td class="align-center"><?php echo htmlentities($v['lg_desc']); ?></td>
      </tr>
    <?php endforeach; endif; else: echo "" ;endif; else: ?>
      <tr class="no_data">
        <td colspan="15"><?php echo htmlentities(lang('ds_no_record')); ?></td>
      </tr>
     <?php endif; ?>
    </tbody>
  </table>
  <?php echo $show_page; ?>

</div>
<script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/highcharts/highcharts.js"></script>
<script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/statistics.js"></script>
<script>
//展示搜索时间框
function show_searchtime(){
    s_type = $("#search_type").val();
    $("[id^='searchtype_']").hide();
    $("#searchtype_"+s_type).show();
}

$(function () {
    //统计数据类型
    var s_type = $("#search_type").val();
    $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});

    show_searchtime();
    $("#search_type").change(function(){
        show_searchtime();
    });

    //更新周数组
    $("[name='search_time_month']").change(function(){
        var year = $("[name='search_time_year']").val();
        var month = $("[name='search_time_month']").val();
        $("[name='search_time_week']").html('');
        $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
            if(data != null){
                for(var i = 0; i < data.length; i++) {
                    $("[name='search_time_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
                }
            }
        });
    });

    $('#container').highcharts(<?php echo $stat_json; ?>);

    $('#dssubmit').click(function(){
        $('#formSearch').submit();
    });
    $('select[name="search_time_year"]').change(function(){
        var s_year = $(this).val();
        $('select[name="search_time_year"]').each(function(){
            $(this).val(s_year);
        });
    });
    $('select[name="search_time_month"]').change(function(){
        var s_month = $(this).val();
        $('select[name="search_time_month"]').each(function(){
            $(this).val(s_month);
        });
    });
    //导出图表
    $("#export_btn").click(function(){
        var item = $("#export_type");
        var type = $(item).val();
        if(type == 'excel'){
            export_xls(item.attr('data-url').replace('.html',''));
        }
    });

    $('#dsexport').click(function(){
        $('#formSearch').submit();
    });
});
</script>